<ui:composition xmlns="http://www.w3.org/1999/xhtml" 
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core" 
	xmlns:c="http://java.sun.com/jstl/core">
	
	<ui:param name="renderForLoggedIn" value="#{securityContext.loggedIn}" />	
	
	<h:form rendered="#{renderForLoggedIn}">
		<h:outputLabel value="Bem vindo: "/>
		<h:commandLink target="/auth/user_edit.jsf" value="#{sessionManagement.loggedInUsername}">
			<f:param name="userid" value="#{securityContext.user.id}" />
		</h:commandLink> 
		<!--  <h:link value="#{sessionManagement.loggedInUsername}" outcome="user"> </h:link>-->
		<h:outputLabel value=" | " />
		<h:commandLink action="#{securityContext.logout()}" value="Logout"/>
	</h:form>
		

	<h:form rendered="#{!renderForLoggedIn}">	
		<h:link value="#{messages['login.label']}" outcome="login" />
		<h:outputLabel value=" | " />			
		<h:link value="#{messages['register.label']}" outcome="user_register" />
	</h:form>

</ui:composition>